package com.ruoyi.rabbitMQ;

import com.ruoyi.framework.config.RabbitmqConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.amqp.core.Message;
import com.rabbitmq.client.Channel;

import java.io.IOException;


/**
 * @Author yinwenhao
 * @Date 2020-11-26
 * @desc 消费者--消费延时消息
 */
@Component
public class ConsumeDelayMsg {

  /* @Autowired
   RabbitTemplate rabbitTemplate;

    *//*消费者监听队列*//*
   @RabbitListener(queues={RabbitmqConfig.QUEUE_PAY})
   public void getMessage(String msg, Message message, Channel channel) throws IOException {
       System.out.println("接收到消息:"+msg);
       channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    }*/

}
